package com.hooya.fa.eu.api.enums;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description 1
 * @Author : Zongz
 * @Copyright Copyright (c) 豪雅集团
 * @Create 2023/11/29
 * @Version 1.0.0
 */
@Getter
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public enum CountryEnum {

    PL("PL", "波兰"),

    FR("FR", "法国"),

    DE("DE", "德国"),

    IT("IT", "意大利");

    private String country;

    private String name;

    public static Boolean isInCountryExDE(String country) {
        for (CountryEnum value : CountryEnum.values()) {
            if (country.equals(value.country) && !value.country.equals(DE.country)) {
                return true;
            }
        }
        return false;
    }

    public static Boolean isInCountryExFR(String country) {
        for (CountryEnum value : CountryEnum.values()) {
            if (country.equals(value.country) && !value.country.equals(FR.country)) {
                return true;
            }
        }
        return false;
    }

    public static List<String> getCountryList() {
        List<String> res = new ArrayList<>();
        for (CountryEnum value : CountryEnum.values()) {
            res.add(value.country);
        }
        return res;
    }

    public static List<String> getListExDE() {
        List<String> res = new ArrayList<>();
        for (CountryEnum value : CountryEnum.values()) {
            if (!value.country.equals(DE.country)) {
                res.add(value.country);
            }
        }
        return res;
    }
}
